home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
COMAL
/
U-User Group
/
(k)u3.d64
/
prowriterdump.l
< prev
next >
Wrap
Text File
|
2007-02-28
|
6KB
|
180 lines
9000 DIM HSBIT(256)
9002 MIRRORBIT(HSBIT)
9004 READ'HIDDEN'RAM'SETUP
9006 BIT'MAP'PRINT(HSBIT)
9008 END
9010 // THIS PROGRAM IS A MODIFIED VERSION OF A SCREEN DUMP PROGRAM BY:
9012 // ╘.┬.╚.╦UIPER 1984
9014 // IT WAS MODIFIED BY ╚ARRY ╙EIDMAN.
9016 // THIS PROGRAM DUMPS THE HIGH RESOLUTION BIT MAP TO THE LINE PRINTER;
9018 // THIS VERSION IS CONFIGURED BY A PROWRITER PRINTER WITH ANY INTERFACE
9020 // SET TO TRANSPARENT MODE. (I.E. THE ASCII BITS ARE TRANSFER UNMODIFIED)
9022 // THIS VERSION SHOULD ALSO WORK ON THE NEC 8023A PRINTER.
9024 //
9026 // EXAMPLE OF USE:
9028 // THIS PROGRAM WILL DUMP A
9030 // PICTURE CURRENTLY IN
9032 // ╚I ╥ES. ┘OU CAN ADD YOUR
9034 // OWN CODE BEFOR LINE 9000
9036 // TO DRAW A PICTURE TO
9038 // ╚I ╥ES.
9040 //
9042 PROC BIT'MAP'PRINT(REF HSBIT()) CLOSED
9044 PRINT CHR$(147)
9046 DIM YN$ OF 1
9048 INPUT "DO YOU WANT TO REVERSE THE IMAGE ? ": YN$
9050 CASE YN$ OF
9052 WHEN "Y","┘"
9054 HSMASK:=0
9056 OTHERWISE
9058 HSMASK:=255
9060 ENDCASE
9062 BIT'MAP:=57344
9064 NUM'DOTS:=500 //NUMBER OF DOTS PER LINE FROM LEFT MARGIN
9066 NUM'DOTS'HI:=INT(NUM'DOTS/256)
9068 NUM'DOTS'LO:=NUM'DOTS-256*NUM'DOTS'HI
9070 DIM OUT$ OF NUM'DOTS+6
9072 SELECT OUTPUT "LP:"
9074 PRINT CHR$(27)+"┼", // FORMFEED; PITCH 12 CPI
9076 SKIP'LINES(20) // CENTER PLOT ON PAGE
9078 PRINT CHR$(27)+"T16"+CHR$(27)+">" // LINE FEED TO 16/144 INCH
9080 FOR COLUMN:=0 TO 39 DO
9082 OUT$:=CHR$(27)+"S0500" // CLEAR PREVIOUS LINE FROM OUTPUT STRING
9084 FOR I:=1 TO NUM'DOTS-402 DO // PUT IN LEADING BLANKS...
9086 OUT$:=OUT$+CHR$(0) // ...TO MOVE THE BIT-MAP...
9088 ENDFOR I // ...IMAGE OFF THE PAPER MARGIN
9090 OUT$:=OUT$+CHR$(0)+CHR$(0)
9092 FOR ROW:=24 TO 0 STEP -1 DO // PUT ALL THE 'CHARACTERS' FROM THE ...
9094 CHAR'ADDR:=BIT'MAP+8*(COLUMN+40*ROW) // ...CURRENT COLUMN INTO THE ...
9096 GET'BYTES(CHAR'ADDR,OUT$,HSBIT,HSMASK) // ... OUTPUT STRING
9098 ENDFOR ROW
9100 PRINT OUT$ // PRINT THE COLUMN
9102 ENDFOR COLUMN
9104 OUT$:=""
9106 PRINT OUT$
9108 SKIP'LINES(20) // MOVE TO NEXT PAGE
9110 SELECT OUTPUT "DS:"
9112 ENDPROC BIT'MAP'PRINT
9114 //
9116 PROC SKIP'LINES(N) CLOSED
9118 FOR I:=1 TO N DO
9120 PRINT CHR$(10),
9122 ENDFOR I
9124 ENDPROC SKIP'LINES
9126 //
9128 PROC READ'HIDDEN'RAM'SETUP
9130 // TO READ HIDDEN RAM:
9132 // SET UP MACHINE CODE BY CALLING THIS PROCEDURE,
9134 // POKE ADDRESS TO READ INTO 842 (LOW BYTE) AND 843 (HIGH BYTE),
9136 // SYS 829, AND
9138 // PEEK CONTENTS FROM 855.
9140 //
9142 // 828 TEMPORARY STORAGE FOR MEMORY CONTROL REGISTER
9144 POKE 829,173 // LDA... (SAVE...
9146 POKE 830,1 // ...1 + (...THE...
9148 POKE 831,0 // ...0*256 (=1) (...MEMORY...
9150 POKE 832,141 // STA... (...CONTROL...
9152 POKE 833,60 // ...60 + (...SETTING
9154 POKE 834,3 // ...3*256 (=828)
9156 POKE 835,120 // SEI (DISABLE INTERRUPTS
9158 POKE 836,73 // EOR... (REVERSE...
9160 POKE 837,7 // ...$7 (...THE...
9162 POKE 838,141 // STA... (...MEMORY...
9164 POKE 839,1 // ... (...CONTROL...
9166 POKE 840,0 // ...(=1) (...SETTING
9168 POKE 841,173 // LDA...
9170 // 842 ...LOW BYTE OF ADDRESS TO READ
9172 // 843 ...HIGH BYTE OF ADDRESS TO READ
9174 POKE 844,141 // STA... (FETCH...
9176 POKE 845,87 // ...87 + (...DESIGNATED...
9178 POKE 846,3 // ...3*256 (=855) (..BYTE
9180 POKE 847,173 // LDA... (RESTORE...
9182 POKE 848,60 // ... (...THE...
9184 POKE 849,3 // ...(=828) (...MEMORY...
9186 POKE 850,141 // STA... (...CONTROL...
9188 POKE 851,1 // ... (...SETTING
9190 POKE 852,0 // ...(=1)
9192 POKE 853,88 // CLI (ENABLE INTERRUPTS
9194 POKE 854,96 // RTS
9196 // 855 CONTAINS RETRIEVED BYTE
9198 ENDPROC READ'HIDDEN'RAM'SETUP
9200 //
9202 PROC GET'BYTES(CHAR'ADDR,REF OUT$,REF HSBIT(),HSMASK) CLOSED
9204 // GET THE EIGHT BYTES OF A 'CHARACTER' FROM CHARACTER ROM OR BIT MAP ...
9206 // ... AND APPEND TO 'OUT$'.
9208 FOR BYTE:=7 TO 0 STEP -1 DO
9210 BYTE'ADDR:=BYTE+CHAR'ADDR
9212 HIGH'BYTE#:=INT(BYTE'ADDR/256)
9214 LOW'BYTE#:=BYTE'ADDR-256*HIGH'BYTE#
9216 POKE 842,LOW'BYTE#
9218 POKE 843,HIGH'BYTE#
9220 SYS 829
9222 BITVAL:=XOR(PEEK(855),HSMASK)+1
9224 BITVAL:=HSBIT(BITVAL)
9226 OUT$:=OUT$+CHR$(BITVAL)+CHR$(BITVAL)
9228 ENDFOR BYTE
9230 ENDPROC GET'BYTES
9232 //
9234 FUNC SCREEN'CODE(ASCII$) CLOSED //RETURN SCREEN CODE VALUE OF CHARACTER
9236 AS:=ORD(ASCII$)
9238 RETURN LAND(AS,128)/2+LAND(AS,63)
9240 ENDFUNC SCREEN'CODE
9242 //
9244 FUNC LOGICAL'SET'UP(NUM,MASK,OP) CLOSED
9246 //
9248 // SET UP MACHINE CODE TO RESIDE
9250 // BETWEEN THE SCREEN AND THE
9252 // SPRITE POINTERS.
9254 //
9256 POKE 2024,169
9258 POKE 2025,NUM
9260 POKE 2026,OP
9262 POKE 2027,MASK
9264 POKE 2028,141
9266 POKE 2029,240
9268 POKE 2030,7
9270 POKE 2031,96
9272 SYS 2024
9274 RETURN PEEK(2032)
9276 ENDFUNC LOGICAL'SET'UP
9278 //
9280 FUNC LAND(NUM,MASK) CLOSED
9282 RETURN LOGICAL'SET'UP(NUM,MASK,41)
9284 ENDFUNC LAND
9286 //
9288 FUNC LOR(NUM,MASK) CLOSED
9290 RETURN LOGICAL'SET'UP(NUM,MASK,9)
9292 ENDFUNC LOR
9294 //
9296 FUNC XOR(NUM,MASK) CLOSED
9298 RETURN LOGICAL'SET'UP(NUM,MASK,73)
9300 ENDFUNC XOR
9302 END
9304 PROC MIRRORBIT(REF VAL()) CLOSED
9306 // THE PROWRITER NEED THE MIRROR IMAGE OF THE BIT PATTERN TO WORK PROPERLY
9308 // (I.E. 11000000 BECOMES 00000011)
9310 // THIS ROUTINE SETS UP AN ARRAY THAT ALLOWS THIS TO HAPPEN
9312 ZONE 10
9314 I:=0
9316 FOR I1:=0 TO 1 DO
9318 FOR I2:=0 TO 1 DO
9320 FOR I3:=0 TO 1 DO
9322 FOR I4:=0 TO 1 DO
9324 FOR I5:=0 TO 1 DO
9326 FOR I6:=0 TO 1 DO
9328 FOR I7:=0 TO 1 DO
9330 FOR I8:=0 TO 1 DO
9332 IHS:=I8*128+I7*64+I6*32+I5*16+I4*8+I3*4+I2*2+I1
9334 I:=I+1
9336 VAL(I):=IHS
9338 //PRINT I,IHS
9340 ENDFOR I8
9342 ENDFOR I7
9344 ENDFOR I6
9346 ENDFOR I5
9348 ENDFOR I4
9350 ENDFOR I3
9352 ENDFOR I2
9354 ENDFOR I1
9356 ENDPROC MIRRORBIT